/**
 * http://usejsdoc.org/
 */
var url = require("url");   //内部模块，直接引用
var querystring = require("querystring");  //转换查询参数串

function getData(req,cb){
	var query = url.parse(req.url,true).query;
	cb(query);
}


function postData(req,cb){
	var postdata = "";
	req.on("data",function(chunk){   //监听数据传输
		postdata += chunk; 
	});

	req.on("end",function(){  //监听数据传输的结束状态，需要进行下一步处理，如：数据库查询等
					
		var query = querystring.parse(postdata);
		cb(query);
	});			
}

exports.getData = getData;
exports.postData = postData;